package cn.wolfcode.service;

import cn.wolfcode.domain.OperateIntergralVo;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * Created by lanxw
 */
@LocalTCC
public interface IUsableIntegralService {
    void decrIntergral(OperateIntergralVo vo);

    void incrIntegral(OperateIntergralVo vo);

    @TwoPhaseBusinessAction(name = "decrIntergralTry",
            commitMethod = "decrIntergralConfirm",
            rollbackMethod = "decrIntergralRollback")
    void decrIntergralTry(
            @BusinessActionContextParameter(paramName = "vo") OperateIntergralVo vo,
            BusinessActionContext context);
    void decrIntergralConfirm(BusinessActionContext context);
    void decrIntergralRollback(BusinessActionContext context);
}
